function require(path) {
  const map = {
    "./a.js": a,
    "./b.js": b,
  };

  const module = {
    exports: {},
  };

  const fn = map[path];
  fn(require, module, module.exports);

  return module.exports;
}

function a(require, module, exports) {
  const fn = require("./b.js");
  const a = 1;

  fn();
}
require("./a.js");

function b(require, module, exports) {
  const a = 1;

  const fn = () => {
    console.log("b");
  };

  module.exports = fn;
}
